home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 94 / CD-ROM 94.iso / util / weban / setup.msi / Cabs.w19.cab / report.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-03-08  |  16.8 KB  |  426 lines

  1. <?xml version="1.0"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.  
  4.     <xsl:variable name="ScoreLookup">
  5.       <c score="0" url="Graphics/dash.gif" alttext="Check Not Performed"/>
  6.       <c score="1" url="Graphics/excl_red.gif" alttext="Unable to scan"/>
  7.       <c score="2" url="Graphics/x_red.gif" alttext="Check failed (critical)"/>
  8.       <c score="3" url="Graphics/x_gold.gif" alttext="Check failed (non-critical)"/>
  9.       <c score="4" url="Graphics/astrx.gif" alttext="Best practice"/>
  10.       <c score="5" url="Graphics/chek_grn.gif" alttext="Check passed"/>
  11.       <c score="6" url="Graphics/dash.gif" alttext="Check not performed"/>
  12.       <c score="7" url="Graphics/info.gif" alttext="Additional information"/>
  13.  
  14.     </xsl:variable>
  15.     
  16.     <xsl:variable name="Assessment">
  17.       <c score="1" text="Unable to Scan" longtext="Could not complete one or more requested checks."/>
  18.       <c score="2" text="Severe Risk" longtext="One or more critical checks failed."/>
  19.       <c score="3" text="Potential Risk" longtext="One or more non-critical checks failed."/>
  20.       <c score="4" text="Security FYIs" longtext=""/>
  21.       <c score="5" text="Strong Security" longtext="All checks were passed."/>
  22.     </xsl:variable>
  23.  
  24.     <xsl:variable name="FileName" select="'file name here'"></xsl:variable>
  25.     
  26.         <xsl:template match="SecScan">
  27.             <xsl:param name="assess" select="@Grade"/>    
  28.             <table>
  29.             <tr>
  30.                 <td class="reportsubheader" width="140">Computer name:</td>
  31.                 <td><xsl:value-of select="@Domain"/>\<xsl:value-of select="@Machine"/></td>
  32.             </tr>
  33.             <tr>
  34.                 <td class="reportsubheader" width="140">IP address:</td>
  35.                 <td><xsl:value-of select="@IP"/></td>
  36.             </tr>
  37.             <tr>
  38.                 <td class="reportsubheader" width="140">Security report name:</td>
  39.                 <td><xsl:value-of select="$FileName" /></td>
  40.             </tr>
  41.             <tr>
  42.                 <td class="reportsubheader" width="140">Scan date:</td>
  43.                  <xsl:choose>
  44.                   <xsl:when test="@LDate">
  45.                     <td><xsl:value-of select="@LDate"/></td>
  46.                   </xsl:when>
  47.                   <xsl:otherwise>
  48.                     <td><xsl:value-of select="@Date"/></td>
  49.                   </xsl:otherwise>
  50.                 </xsl:choose>        
  51.             </tr>
  52.             <xsl:choose>
  53.             <xsl:when test="@HotfixDataVersion">
  54.                   <tr>
  55.                     <td class="reportsubheader" width="140">Hotfix database version:</td>
  56.                     <td><xsl:value-of select="@HotfixDataVersion"/></td>
  57.                 </tr>
  58.             </xsl:when>
  59.             </xsl:choose>        
  60.             <tr>
  61.                 <td class="reportsubheader" width="140">Security assessment:</td>
  62.                 <td><xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@text"/><xsl:text> </xsl:text>(<xsl:value-of select="document('')/*/xsl:variable[@name='Assessment']/c[@score=$assess]/@longtext"/>)</td>
  63.             </tr>
  64.             
  65.             <xsl:choose>
  66.             <xsl:when test="Check[@ID='125']">
  67.                 <tr>
  68.                     <td colspan="2" class="reportsubheader">
  69.                         <br />
  70.                         This computer is running Windows .NET Server. This version of Windows is not officially supported in this release.
  71.                         <br />
  72.                     </td>
  73.                 </tr>    
  74.             </xsl:when>
  75.             </xsl:choose>
  76.             </table>
  77.             
  78.             <xsl:choose>
  79.             <xsl:when test="Check[@Type='1']">
  80.                 <br />
  81.                 <div class="reportheader">Windows Scan Results</div>
  82.                 <xsl:choose>
  83.                 <xsl:when test="Check[@Type='1'][@Cat='1']">
  84.                     <br />
  85.                     <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Vulnerabilities</div>
  86.                     <br />
  87.                     <table width="100%" border="0" cellpadding="4" cellspacing="0">
  88.                         <tr class="ReportListHeader">
  89.                             <td class="ReportListHeader" style="WIDTH:60" align="center" valign="middle">Score</td>
  90.                             <td class="ReportListHeader" style="WIDTH:40" align="left">Issue</td>
  91.                             <td class="ReportListHeader">Result</td>
  92.                         </tr>
  93.                         <xsl:for-each select=".">
  94.                             <xsl:apply-templates select="Check[@Type='1'][@Cat='1']">
  95.                                 <xsl:sort order="sortorder" select="sortfield"/>
  96.                                 <xsl:sort select="@Rank"/>
  97.                             </xsl:apply-templates>
  98.                         </xsl:for-each>
  99.                     </table>            
  100.                 </xsl:when>
  101.                 </xsl:choose>
  102.                 <xsl:choose>
  103.                 <xsl:when test="Check[@Type='1'][@Cat='2']">
  104.                     <br />
  105.                     <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Additional System Information</div>
  106.                     <br />
  107.                     <table width="100%" border="0" cellpadding="4" cellspacing="0">
  108.                         <tr class="ReportListHeader">
  109.                             <td class="ReportListHeader" style="WIDTH:60" align="center" valign="middle">Score</td>
  110.                             <td class="ReportListHeader" style="WIDTH:40" align="left">Issue</td>
  111.                             <td class="ReportListHeader">Result</td>
  112.                         </tr>
  113.                         <xsl:for-each select=".">
  114.                             <xsl:apply-templates select="Check[@Type='1'][@Cat='2']">
  115.                                 <xsl:sort select="@Rank"/>
  116.                             </xsl:apply-templates>
  117.                         </xsl:for-each>
  118.                     </table>
  119.                 </xsl:when>
  120.                 </xsl:choose>
  121.             </xsl:when>
  122.             </xsl:choose>
  123.  
  124.             <xsl:choose>
  125.             <xsl:when test="Check[@Type='3']">    
  126.                 <br />
  127.                 <div class="reportheader">Internet Information Services (IIS) Scan Results</div>
  128.                 <xsl:choose>
  129.                 <xsl:when test="Check[@Type='3'][@Cat='1']">
  130.                     <br />
  131.                     <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Vulnerabilities</div>
  132.                     <br />
  133.                     <table width="100%" border="0" cellpadding="4" cellspacing="0">
  134.                         <tr class="ReportListHeader">
  135.                             <td class="ReportListHeader" style="WIDTH:60" align="center" valign="middle">Score</td>
  136.                             <td class="ReportListHeader" style="WIDTH:40" align="left">Issue</td>
  137.                             <td class="ReportListHeader">Result</td>
  138.                         </tr>
  139.                         <xsl:for-each select=".">
  140.                             <xsl:apply-templates select="Check[@Type='3'][@Cat='1']">
  141.                                 <xsl:sort order="sortorder" select="sortfield"/>
  142.                                 <xsl:sort select="@Rank"/>
  143.                             </xsl:apply-templates>
  144.                         </xsl:for-each>
  145.                     </table>            
  146.                 </xsl:when>
  147.                 </xsl:choose>
  148.                 <xsl:choose>
  149.                 <xsl:when test="Check[@Type='3'][@Cat='2']">
  150.                     <br />
  151.                         <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Additional System Information</div>
  152.                     <br />
  153.                     <table width="100%" border="0" cellpadding="4" cellspacing="0">
  154.                         <tr class="ReportListHeader">
  155.                             <td class="ReportListHeader" style="WIDTH:60" align="center" valign="middle">Score</td>
  156.                             <td class="ReportListHeader" style="WIDTH:40" align="left">Issue</td>
  157.                             <td class="ReportListHeader">Result</td>
  158.                         </tr>
  159.                         <xsl:for-each select=".">
  160.                             <xsl:apply-templates select="Check[@Type='3'][@Cat='2']">
  161.                                 <xsl:sort order="sortorder" select="sortfield"/>
  162.                                 <xsl:sort select="@Rank"/>
  163.                             </xsl:apply-templates>
  164.                         </xsl:for-each>
  165.                     </table>
  166.                 </xsl:when>
  167.                 </xsl:choose>
  168.             </xsl:when>
  169.             </xsl:choose>
  170.             <xsl:choose>
  171.             <xsl:when test="Check[@Type='3'][@Cat='4']">
  172.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  173.                         <tr class="ReportListHeader">
  174.                             <td class="ReportListHeader" style="WIDTH:60" align="center" valign="middle">Score</td>
  175.                             <td class="ReportListHeader" style="WIDTH:40" align="left">Issue</td>
  176.                             <td class="ReportListHeader">Result</td>
  177.                         </tr>
  178.                     <xsl:for-each select=".">
  179.                         <xsl:apply-templates select="Check[@Type='3'][@Cat='4']">
  180.                             <xsl:sort order="sortorder" select="sortfield"/>
  181.                             <xsl:sort select="@Rank"/>
  182.                         </xsl:apply-templates>
  183.                     </xsl:for-each>
  184.                 </table>
  185.             </xsl:when>
  186.             </xsl:choose>
  187.                 
  188.             <xsl:choose>
  189.             <xsl:when test="Check[@Type='2']">    
  190.                 <br />
  191.                 <div class="reportheader">SQL Server Scan Results</div>
  192.                 <xsl:choose>
  193.                 <xsl:when test="Check[@Type='2'][@Cat='1']">
  194.                     <br />
  195.                     <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Vulnerabilities</div>
  196.                     <br />
  197.                     <table width="100%" border="0" cellpadding="4" cellspacing="0">
  198.                         <tr class="ReportListHeader">
  199.                             <td class="ReportListHeader" style="WIDTH:60" align="center" valign="middle">Score</td>
  200.                             <td class="ReportListHeader" style="WIDTH:40" align="left">Issue</td>
  201.                             <td class="ReportListHeader">Result</td>
  202.                         </tr>
  203.                         <xsl:for-each select=".">
  204.                             <xsl:apply-templates select="Check[@Type='2'][@Cat='1']">
  205.                                 <xsl:sort order="sortorder" select="sortfield"/>
  206.                                 <xsl:sort select="@Rank"/>
  207.                             </xsl:apply-templates>
  208.                         </xsl:for-each>
  209.                     </table>            
  210.                 </xsl:when>
  211.                 </xsl:choose>
  212.                 <xsl:choose>
  213.                 <xsl:when test="Check[@Type='2'][@Cat='2']">
  214.                     <br />
  215.                         <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Additional System Information</div>
  216.                     <br />
  217.                     <table width="100%" border="0" cellpadding="4" cellspacing="0">
  218.                         <tr class="ReportListHeader">
  219.                             <td class="ReportListHeader" style="WIDTH:60" align="center" valign="middle">Score</td>
  220.                             <td class="ReportListHeader" style="WIDTH:40" align="left">Issue</td>
  221.                             <td class="ReportListHeader">Result</td>
  222.                         </tr>
  223.                         <xsl:for-each select=".">
  224.                             <xsl:apply-templates select="Check[@Type='2'][@Cat='2']">
  225.                                 <xsl:sort order="sortorder" select="sortfield"/>
  226.                                 <xsl:sort select="@Rank"/>
  227.                             </xsl:apply-templates>
  228.                         </xsl:for-each>
  229.                     </table>
  230.                 </xsl:when>
  231.                 </xsl:choose>
  232.             </xsl:when>
  233.             </xsl:choose>
  234.             <xsl:choose>
  235.             <xsl:when test="Check[@Type='2'][@Cat='4']">
  236.                 <table width="100%" border="0" cellpadding="4" cellspacing="0">
  237.                         <tr class="ReportListHeader">
  238.                             <td class="ReportListHeader" style="WIDTH:60" align="center" valign="middle">Score</td>
  239.                             <td class="ReportListHeader" style="WIDTH:40" align="left">Issue</td>
  240.                             <td class="ReportListHeader">Result</td>
  241.                         </tr>
  242.                     <xsl:for-each select=".">
  243.                         <xsl:apply-templates select="Check[@Type='2'][@Cat='4']">
  244.                             <xsl:sort order="sortorder" select="sortfield"/>
  245.                             <xsl:sort select="@Rank"/>
  246.                         </xsl:apply-templates>
  247.                     </xsl:for-each>
  248.                 </table>
  249.             </xsl:when>
  250.             </xsl:choose>
  251.                 
  252.             <xsl:choose>
  253.             <xsl:when test="Check[@Type='4']">    
  254.                 <br />
  255.                 <div class="reportheader">Desktop Application Scan Results</div>
  256.                 <xsl:choose>
  257.                 <xsl:when test="Check[@Type='4'][@Cat='1']">
  258.                     <br />
  259.                     <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Vulnerabilities</div>
  260.                     <br />
  261.                     <table width="100%" border="0" cellpadding="4" cellspacing="0">
  262.                         <tr class="ReportListHeader">
  263.                             <td class="ReportListHeader" style="WIDTH:60" align="center" valign="middle">Score</td>
  264.                             <td class="ReportListHeader" style="WIDTH:40" align="left">Issue</td>
  265.                             <td class="ReportListHeader">Result</td>
  266.                         </tr>
  267.                         <xsl:for-each select=".">
  268.                             <xsl:apply-templates select="Check[@Type='4'][@Cat='1']">
  269.                                 <xsl:sort order="sortorder" select="sortfield"/>
  270.                                 <xsl:sort select="@Rank"/>
  271.                             </xsl:apply-templates>
  272.                         </xsl:for-each>
  273.                     </table>            
  274.                 </xsl:when>
  275.                 </xsl:choose>
  276.                 <xsl:choose>
  277.                 <xsl:when test="Check[@Type='4'][@Cat='2']">
  278.                     <br />
  279.                         <div class="reportsubheader" style="MARGIN-LEFT: 5px;">Additional System Information</div>
  280.                     <br />
  281.                     <table width="100%" border="0" cellpadding="4" cellspacing="0">
  282.                         <tr class="ReportListHeader">
  283.                             <td class="ReportListHeader" style="WIDTH:60" align="center" valign="middle">Score</td>
  284.                             <td class="ReportListHeader" style="WIDTH:40" align="left">Issue</td>
  285.                             <td class="ReportListHeader">Result</td>
  286.                         </tr>
  287.                         <xsl:for-each select=".">
  288.                             <xsl:apply-templates select="Check[@Type='4'][@Cat='2']">
  289.                                 <xsl:sort select="@Rank"/>
  290.                             </xsl:apply-templates>
  291.                         </xsl:for-each>
  292.                     </table>
  293.                 </xsl:when>
  294.                 </xsl:choose>
  295.             </xsl:when>
  296.             </xsl:choose>    
  297.         </xsl:template>
  298.     
  299.     <xsl:template match="Check">
  300.         <xsl:param name="score" select="@Grade"/>
  301.             <xsl:variable name="classname">
  302.             <xsl:choose>
  303.                 <xsl:when test="(position() mod 2) = 1">ReportsRowOverEven</xsl:when>
  304.                 <xsl:otherwise>ReportsRowOverOdd</xsl:otherwise>
  305.             </xsl:choose>
  306.             </xsl:variable>
  307.             <tr class="{$classname}">
  308.                 <td align="center" valign="middle">
  309.                     <xsl:choose>
  310.                       <xsl:when test="@Cat='2'">
  311.                         <xsl:choose>
  312.                           <xsl:when test="@ID='121'">
  313.                             <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  314.                            </xsl:when>
  315.                           <xsl:when test="@ID='101'">
  316.                             <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  317.                            </xsl:when>
  318.                           <xsl:otherwise>
  319.                             <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@url}" />
  320.                           </xsl:otherwise>
  321.                         </xsl:choose>
  322.                       </xsl:when>
  323.                       <xsl:otherwise>
  324.                         <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@url}" />    
  325.                       </xsl:otherwise>
  326.                     </xsl:choose>    
  327.                 </td>
  328.                 <td style="WIDTH:75"><xsl:value-of select="@Name"/></td>
  329.                 <td> 
  330.                     <TABLE width="100%">  
  331.                       <TR>
  332.                         <TD align="left" colspan="3"><xsl:value-of select="Advice"/></TD>
  333.                       </TR>
  334.                       <TR>
  335.                       <TD>
  336.                       <TABLE>
  337.                       <TR>
  338.                         <xsl:choose>
  339.                             <xsl:when test="$score=5">
  340.                                 <xsl:choose>
  341.                                   <xsl:when test="@URL1">
  342.                                     <TD width="100" NoWrap="true"><A class="sys-link-normal" style="PADDING-LEFT: 1px;PADDING-BOTTOM:0px;PADDING-TOP: 0px;PADDING-RIGHT:0px" target="_new" href="{@URL1}">What was scanned</A></TD>                       
  343.                                   </xsl:when>
  344.                                   <xsl:otherwise>
  345.                                     <TD width="100" NoWrap="true"></TD>                       
  346.                                   </xsl:otherwise>
  347.                                 </xsl:choose>                    
  348.                                 <xsl:choose>
  349.                                   <xsl:when test="Detail">
  350.                                     <TD NoWrap="true" width="70"><A class="sys-link-normal" style="PADDING-LEFT: 1px;PADDING-BOTTOM:0px;PADDING-TOP: 0px;PADDING-RIGHT:0px" href="javascript:OpenDetails('{@ID}')">Result details</A></TD>    
  351.                                   </xsl:when>
  352.                                   <xsl:otherwise>
  353.                                     <TD NoWrap="true" width="70"></TD>    
  354.                                   </xsl:otherwise>
  355.                                 </xsl:choose>            
  356.                                 <xsl:choose>
  357.                                   <xsl:when test="@URL2">
  358.                                     <TD width="120" NoWrap="true"></TD>
  359.                                   </xsl:when>
  360.                                   <xsl:otherwise>
  361.                                     <TD width="120" NoWrap="true"></TD>                       
  362.                                   </xsl:otherwise>
  363.                                 </xsl:choose>                                            
  364.                             </xsl:when>
  365.                             <xsl:when test="$score=4">
  366.                                 <xsl:choose>
  367.                                   <xsl:when test="@URL1">
  368.                                     <TD width="100" NoWrap="true"><A class="sys-link-normal" style="PADDING-LEFT: 1px;PADDING-BOTTOM:0px;PADDING-TOP: 0px;PADDING-RIGHT:0px" target="_new" href="{@URL1}">What was scanned</A></TD>                       
  369.                                   </xsl:when>
  370.                                   <xsl:otherwise>
  371.                                     <TD width="100" NoWrap="true"></TD>                       
  372.                                   </xsl:otherwise>
  373.                                 </xsl:choose>                    
  374.                                 <xsl:choose>
  375.                                   <xsl:when test="Detail">
  376.                                     <TD NoWrap="true" width="70"><A class="sys-link-normal" style="PADDING-LEFT: 1px;PADDING-BOTTOM:0px;PADDING-TOP: 0px;PADDING-RIGHT:0px" href="javascript:OpenDetails('{@ID}')">Result details</A></TD>    
  377.                                   </xsl:when>
  378.                                   <xsl:otherwise>
  379.                                     <TD NoWrap="true" width="70"></TD>    
  380.                                   </xsl:otherwise>
  381.                                 </xsl:choose>            
  382.                                 <xsl:choose>
  383.                                   <xsl:when test="@URL2">
  384.                                     <TD width="120" NoWrap="true"></TD>
  385.                                   </xsl:when>
  386.                                   <xsl:otherwise>
  387.                                     <TD width="120" NoWrap="true"></TD>                       
  388.                                   </xsl:otherwise>
  389.                                 </xsl:choose>                                            
  390.                             </xsl:when>
  391.                             <xsl:otherwise>
  392.                                 <xsl:choose>
  393.                                   <xsl:when test="@URL1">
  394.                                     <TD width="100" NoWrap="true"><A class="sys-link-normal" style="PADDING-LEFT: 1px;PADDING-BOTTOM:0px;PADDING-TOP: 0px;PADDING-RIGHT:0px" target="_new" href="{@URL1}">What was scanned</A></TD>                       
  395.                                   </xsl:when>
  396.                                   <xsl:otherwise>
  397.                                     <TD width="100" NoWrap="true"></TD>                       
  398.                                   </xsl:otherwise>
  399.                                 </xsl:choose>                    
  400.                                 <xsl:choose>
  401.                                   <xsl:when test="Detail">
  402.                                     <TD NoWrap="true" width="70"><A class="sys-link-normal" style="PADDING-LEFT: 1px;PADDING-BOTTOM:0px;PADDING-TOP: 0px;PADDING-RIGHT:0px" href="javascript:OpenDetails('{@ID}')">Result details</A></TD>    
  403.                                   </xsl:when>
  404.                                   <xsl:otherwise>
  405.                                     <TD NoWrap="true" width="70"></TD>    
  406.                                   </xsl:otherwise>
  407.                                 </xsl:choose>            
  408.                                 <xsl:choose>
  409.                                   <xsl:when test="@URL2">
  410.                                     <TD NoWrap="true" width="120"><A class="sys-link-normal" style="PADDING-LEFT: 1px;PADDING-BOTTOM:0px;PADDING-TOP: 0px;PADDING-RIGHT:0px" target="_new" href="{@URL2}">How to correct this</A></TD>
  411.                                   </xsl:when>
  412.                                   <xsl:otherwise>
  413.                                     <TD width="120" NoWrap="true"></TD>                       
  414.                                   </xsl:otherwise>
  415.                                 </xsl:choose>
  416.                             </xsl:otherwise>
  417.                         </xsl:choose>
  418.                       </TR>
  419.                       </TABLE>
  420.                       </TD>
  421.                       </TR>
  422.                     </TABLE>
  423.                 </td>
  424.             </tr>
  425.     </xsl:template>
  426. </xsl:stylesheet>